package cn.lysj.framework.elm.repository;

import cn.lysj.framework.base.BaseRepository;
import cn.lysj.framework.elm.domain.FoodReleveEleme;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @ Author ：drj.
 * @ Date  ：Created in 11:47 2019/1/16
 * @ Description:
 **/

public interface FoodRelevElemeRepository extends BaseRepository<FoodReleveEleme> {

    //通过门店查询对应的关系表
    List<FoodReleveEleme> findByStoreId(String storeId);

    @Query(value = "SELECT plat_form_food_id  FROM  food_releve_eleme  WHERE store_id=?1", nativeQuery = true)
    List<String> findplatFormFoodIds(String storeId);

    @Query(value = "SELECT eleme_food_id  FROM  food_releve_eleme  WHERE store_id=?1", nativeQuery = true)
    List<String> findElemeFoodIds(String storeId);


    FoodReleveEleme findByElemeFoodId(String elmFoodId);
}
